]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
NetworkMenu: fix handling WWAN devices
authorGiovanni Campagna <gcampagna@src.gnome.org>
Sat, 2 Apr 2011 20:27:20 +0000 (22:27 +0200)
committerDan Winship <danw@gnome.org>
Mon, 11 Apr 2011 14:38:00 +0000 (10:38 -0400)
NMDeviceModem._createSection was not checking whether it should have
shown the connection list, resulting in status item shown even if
the device was in an invalid state.
Also, fix a logic error when creating the operatorItem and fix overriding
_clearSection protected method.

https://bugzilla.gnome.org/show_bug.cgi?id=646395

js/ui/status/network.js

index 90affc3ebd80e7727ac8755b231c4aae4f47ab03..f76d5bbb329a11c767bcf5cef9e0ef4420ed69e2 100644 (file)
@@ -824,12 +824,15 @@ NMDeviceModem.prototype = {
     },
 
     _createSection: function() {
+        if (!this._shouldShowConnectionList())
+            return;
+
         if (this.mobileDevice) {
             // If operator_name is null, just pass the empty string, as the item is hidden anyway
             this._operatorItem = new PopupMenu.PopupImageMenuItem(this.mobileDevice.operator_name || '',
                                                                   this._getSignalIcon(),
                                                                   { reactive: false });
-            if (this.mobileDevice.operator_name)
+            if (!this.mobileDevice.operator_name)
                 this._operatorItem.actor.hide();
             this.section.addMenuItem(this._operatorItem);
         }
@@ -837,7 +840,7 @@ NMDeviceModem.prototype = {
         NMDevice.prototype._createSection.call(this);
     },
 
-    clearSection: function() {
+    _clearSection: function() {
         this._operatorItem = null;
 
         NMDevice.prototype._clearSection.call(this);